package cn.buk.tms.eotms.controller;

import cn.buk.tms.common.dto.base.BaseDto;
import cn.buk.tms.eotms.dto.PaymentOrderDto;
import cn.buk.tms.eotms.service.PaymentService;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;



/**
 *
 * @author yfdai
 * @date 2017-01-07
 */
@RestController
public class PaymentController extends BaseController {

  @Autowired
  public PaymentController(PaymentService paymentService) {
    this.paymentService = paymentService;
  }

  private final PaymentService paymentService;


  @GetMapping("/paymentOrder")
  public BaseDto getPaymentOrderByTradeNo(HttpServletRequest request,
                                          @RequestParam("tradeNo") final String tradeNo) {
    return paymentService.getPaymentOrderByTradeNo(getUserId(request), tradeNo);
  }
}
